#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time   : 2021/6/27 15:31
# @Author : cjw
from web_wework.page.base_page import BasePage

from web_wework.util.file_operator import YmlOperator
from web_wework.setting import ELEMENT_YML


class MainPage(BasePage):
    """企业微信主页面"""

    # 添加定位元素到locators
    BasePage.locators.update(YmlOperator(ELEMENT_YML['mp']).data)

    def goto_contact(self):
        """跳转到通讯录页面"""
        from web_wework.page.contact_page import ContactPage

        self.contact.click()
        return ContactPage(self.driver)

    def goto_add_member(self):
        """跳转到添加成员页面"""
        from web_wework.page.add_member_page import AddMemberPage

        self.main_add_member.click()
        return AddMemberPage(self.driver)
